<?php

namespace App\Http\Controllers;

use Illuminate\Http\Request;
use Picqer\Barcode\BarcodeGeneratorPNG;

class BarcodeController extends Controller
{
    public function index($barcode){

       $barcodeGenerator= new BarcodeGeneratorPNG();
       //dd($barcode);
       $result=$barcodeGenerator->getBarcode($barcode,$barcodeGenerator::TYPE_CODE_128_B);
       return Response($result,200,[
           'Content-type'=>'image/png']);
    }
}
